package test

import (
	"chess/pkg"
	"fmt"
	"log"
)

//const SIZE = 10

//var chessBoard [SIZE][SIZE]string

func gameTest() {
	err := pkg.CreateBoard(1314)
	if err != nil {
		return
	}
	var isBlack = true
	for true {
		fmt.Println("请输入坐标:")
		var x, y int
		_, err := fmt.Scanf("%d,%d", &x, &y)
		if err != nil {
			log.Println(err)

		}
		_, err = pkg.PlayChess(1314, x, y, isBlack)
		if err != nil {
			log.Println(err)
			continue
		}
		isBlack = !isBlack
		_, err = pkg.PrintBoard(1314)
		if err != nil {
			log.Println(err)
		}
		//fmt.Println(board)
		check, err := pkg.WinCheck(1314, x, y)
		if err != nil {
			log.Println(err)
		}
		if check {
			if pkg.BoardMap[1314][x][y] == "●" {
				fmt.Println("黑棋赢了")
				break
			} else {
				fmt.Println("白棋赢了")
				break
			}

		}
	}

}
